package com.lz.ovuola.repository.mysql;

import java.io.Serializable;

import javax.persistence.EntityManager;

import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;

public class MyDynamicRepositoryImpl<T, ID extends Serializable> extends
		SimpleJpaRepository<T, ID> implements MyDynamicRepository<T, ID> {

	private EntityManager entityManager;

	public MyDynamicRepositoryImpl(Class<T> domainClass,
			EntityManager entityManager) {
		super(domainClass, entityManager);
		// This is the recommended method for accessing inherited class
		// dependencies.
		this.entityManager = entityManager;
	}

	public MyDynamicRepositoryImpl(
			JpaEntityInformation<T, ?> entityInformation,
			EntityManager entityManager) {
		super(entityInformation, entityManager);
		// TODO Auto-generated constructor stub
	}

	public void sharedCustomMethod(ID id) {
		// implementation goes here
	}

	public EntityManager getEntityManager() {
		return entityManager;
	}

	public void setEntityManager(EntityManager entityManager) {
		this.entityManager = entityManager;
	}
}